import { Cloud } from 'laf-client-sdk'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const cloud = new Cloud({
  baseUrl: 'https://su75ks.laf.run', // <APP_ID> 在首页应用列表获取
  getAccessToken: () => userStore.token, // 这里不需要授权，先填空
})

export async function getSettingList() {
  const res = await cloud.invoke('curd_op', {
    collection: 'Setting',
    operation: 'getOne',
    data: {
      where: {
        _id: '656554573a76b259288dad3f',
      },
    },
  })
  const status = res.data.status
  const outlook = res.data.outlook
  const period = res.data.period
  return { status, outlook, period }
}
